//
//  JGWinKeyboardButton.h
//  JGInputDriver
//
//  Created by jagger.tu on 2025/3/20.
//

#if TARGET_OS_IOS

#import <Foundation/Foundation.h>
#import <JGVividEngine/JGView.h>
#import <JGVividEngine/JGKeyboardEvent.h>

@class JGWinKeyboardKey;

NS_ASSUME_NONNULL_BEGIN

@class JGWinKeyboardButton;

@protocol JGWinKeyboardButtonDelegate <NSObject>

/// 键盘状态更新
- (void)updateStateFromkeyboardButton:(JGWinKeyboardButton *)keyboardButton;

@end

@interface JGWinKeyboardButton : NSObject

/// 键盘事件代理
@property (nonatomic, weak) id<JGWinKeyboardButtonDelegate> delegate;
/// 相对坐标
@property (nonatomic, assign) CGRect frame;
/// 被按下了
@property (nonatomic, assign, readonly) BOOL isDown;
/// Button
@property (nonatomic, strong, readonly) UIButton *button;
/// 修饰键
@property (nonatomic, assign, readonly) JGKeyboardModifierButton modifier;
/// 键值
@property (nonatomic, assign, readonly) NSInteger code;
/// 初始化按键
- (instancetype)initWithKey:(JGWinKeyboardKey *)key;
/// 重新载入按键,更新按键字符,例如切换中英文输入法时
- (void)reloadWithBShiftDown:(BOOL)bShiftDown bChineseStyle:(BOOL)bChineseStyle;

@end

NS_ASSUME_NONNULL_END

#endif 
